Collapsing the Expanding Menu Selecting an Action

Description

You can close a branch in the Expanding Menu when an action is triggered using the Expanding Menu's collapseMenu() method.

Discussion

Branches in an Expanding Menu control can be collapsed using the collapseMenu() method of the Expanding Menu's JavaScript Object. In order to do this, however, you must set the 'Value' property for the branch nodes you wish to collapse.

For example, the following code could be added to the onClick property for a leaf node in the Expanding Menu to collapse the branch with a Value of 'B1'. The this variable refers to the Expanding Menu object.

var parent = 'B1';
this.collapseMenu(parent);

If used outside of the node's onClick property, you must first get a pointer to the Expanding Menu's JavaScript Object using the {dialog.object}.getControl() method:

' Get the object for the 'EXPANDINGMENU_1' control
var menuObj = {dialog.object}.getControl('EXPANDINGMENU_1');
if (menuObj) {
    var parent = 'B1';
    menuObj.collapseNode(parent);
}

To learn more, watch the video below.

Collapsing Menu When Selecting an Action

When you select the action on a leaf node in an Expanding Menu control, you might want to collapse the menu so that some or all of the expanded nodes are collapsed.

In this video we show how an expanded node in an Expanding Menu control can be collapsed.

Download Component

2018-06-02